package com.three.mapper;

import com.three.entity.Branch;
import com.three.service.BranchService;
import com.three.vo.AddBranchVo;
import com.three.vo.BranchVo;
import com.three.vo.R;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author 天天好心情
* @description 针对表【branch】的数据库操作Mapper
* @createDate 2024-10-21 14:29:19
* @Entity com.three.entity.Branch
*/
public interface BranchMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Branch record);

    int insertSelective(Branch record);

    Branch selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Branch record);
    //按照主键修改
    int updateByPrimaryKey(Branch record);

    //查询所有
    List<Branch> getAll();

    //根据branchid查询
    List<Branch> getBranchByBranchId(Integer branchid);
    //查询所有商铺信息和根据店长id查询店长名称和人数
    List<Branch> getAllAndName(BranchVo branchname);
    //判断商铺id是否重复
    Branch checkBranchid(Integer branchid);

    //判断商铺名是否重复
    Branch checkBranchname(String branchname);


    int addBranch(AddBranchVo addBranch);
    //根据branchid查询门店
    Branch getByBranchId(Integer branchid);

    //修改状态
    int updateState(@Param("branchid") Integer branchid,@Param("state") Integer state);

    //删除部门，根据branchid部门编号删除
    int deleteBybranchid(Integer branchid);
    //修改店长
    int updateDianZhang(@Param("branchid")Integer branchid, @Param("staffid") Integer staffid);

    Branch getUserBranchName(Integer branchid);

    //更换当前门店的店长，更改为空，根据门店名
    int updateByBraanchname(String branchname);

    //查询门店数目
    Integer getBranchCounts();
}
